﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>jQuery属性选择器示例</title>
        <script src="js/jquery-3.6.1.min.js"></script>
        <style>
            a {
                margin: 10px;
            }
        </style>
    </head>
    <body>
        <h3>jQuery属性选择器示例</h3>
        <hr>
        <a href="http://www.sina.com.cn">新浪</a>
        <a href="http://www.163.com">网易</a>
        <a href="http://www.sohu.com">搜狐</a>
        <script>
            $(document).ready(function() {
                //筛选href属性值以.cn结尾的元素
                $("[href$='.cn']").css("border", "5px solid red");
            });
        </script>
    </body>
</html>